tileinstall: Install custom tilesets for JA2 and JA2:UB
Version 1.0 of November 19 2001
By Snap <tacpans@yahoo.com>

usage: JA2_Data custom_tiles

Parameters:
  JA2_Data      JA2\Data (JA2 UB\Data) directory
  custom_tiles  Directory with custom tile files
  
The two directories may be given either as absolute paths (e.g. "C:\Program Files\Interplay\JA2 UB\Data") or relative to the current directory.  If a directory name includes spaces, you must enclose it in double quotes.

Examples:
  tileinstall "C:\Program Files\Interplay\JA2 UB\Data" C:\mytiles
  tileinstall . ..\mytiles

Description:

tileinstall was made to facilitate installation of custom tilesets.  Before you use tileinstall, you must first edit the file ja2set.dat (from BINARYDATA.SLF) and place it in the directory Data\BinaryData.  tileinstall will then compare your custom ja2set.dat with the default ja2set.dat for your game, and attempt to install necessary tileset files in Data\Tilesets.  If a file that needs to be installed is found among default tileset files in TILESETS.SLF, tileinstall will extract it from there.  Otherwise the program will look for the file in the custom directory (specified in the second parameter).  Custom ja2set.dat may contain more tilesets than in the original.  For each custom entry "tile" in ja2set.dat, tileinstall will attempt to install 3 files: tile.sti, T\tile.sti, and tile.jsd.  However, only tile.sti is required for the program to continue normally.  If tile.sti can not be found in either TILESETS.SLF or in the custom directory, the program will exit with an error code 1.

Every tile file must have a unique name.  When naming a custom tile, check the list of default tiles in the enclosed file ja2set_files.txt, and make sure that your custom tile name is different from any of those.

During its operation, tileinstall will temporarily extract the default ja2set.dat file into the current directory.  Make sure that the current directory does not already contain a file by that name, or else it will be deleted.

Tileinstall can be used when distributing a campaign that utilises custom tilesets.  The advantage of using tileinstall is that default tile files from TILESETS.SLF do not need to be included in the distribution, and custom tile files only need to be included once.  This allows the developer to use any number of custom tilesets without regard for the distribution size.  When using tileinstall as part of the installation process, keep in mind that tileinstall returns 0 upon normall completion, and 1 otherwise.  Normall messages are sent to STDOUT, while error messages are sent to STDERR.